using System;
using Microsoft.SPOT;

namespace OST.Shared.Interfaces
{
    /// <summary>
    /// Notifies clients that a property value has changed.
    /// </summary>
    public interface INotifyPropertyChanged
    {
        /// <summary>
        /// Occurs when a property value changes.
        /// </summary>
        event PropertyChangedEventHandler PropertyChanged;
    }

    /// <summary>
    /// Provides data for the System.ComponentModel.INotifyPropertyChanged.PropertyChanged
    ///     event.
    /// </summary>
    public class PropertyChangedEventArgs : EventArgs
    {

        /// <summary>
        /// Initializes a new instance of the System.ComponentModel.PropertyChangedEventArgs
        ///     class.
        /// </summary>
        /// <param name="propertyName">The name of the property that changed</param>
        /// <param name="newValue">new value as object</param>
        public PropertyChangedEventArgs(string propertyName, object newValue)
            : base()
        {
            PropertyName = propertyName;
            PropertyNewValue = newValue;
        }


        /// <summary>
        /// Gets the name of the property that changed.
        /// </summary>
        public string PropertyName { get; private set; }

        public object PropertyNewValue { get; private set; }
    }

    /// <summary>
    /// Represents the method that will handle the System.ComponentModel.INotifyPropertyChanged.PropertyChanged
    ///     event raised when a property is changed on a component.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">A System.ComponentModel.PropertyChangedEventArgs that contains the event
    ///     data.</param>
    public delegate void PropertyChangedEventHandler(object sender, PropertyChangedEventArgs e);
}
